﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Com.CMS263.DAO;
using Com.CMS263.PO;

namespace Com.CMS263.BLL
{
    public class TransactionBLL : BaseBLL<Transaction>
    {
        TransactionDAO dao = new TransactionDAO();
        public Transaction entity = new Transaction();
        public override Transaction GetModel()
        {
            return entity;
        }

          #region 得到单个用户余额信息
        /// <summary>
        /// 得到单个用户余额信息byUserid
        /// </summary>
        /// <param name="userid"></param>
        /// <param name="page"></param>
        /// <param name="pagesize"></param>
        /// <returns></returns>
        public IList<Transaction> GetTransaByUserId(int userid, int page, int pagesize)
        {
            return dao.GetTransaByUserId(userid, page, pagesize);
        }
         /// <summary>
        /// 得到单个用户余额信息总数byUserid
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>
        public int GetTransaByUserId(int userid)
        {
            return dao.GetTransaByUserId(userid);
        }
          #endregion
        public Transaction GetMaxTran(int userId)
        {
            return dao.GetMaxTran(userId);
        }
        /// <summary>
        /// 注册
        /// </summary>
        /// <param name="tr"></param>
        /// <returns></returns>
        public bool InsertTrans(Transaction tr)
        {
            return dao.InsertTrans(tr);
        }
    }
}
